Skip to content

Conversation

@jimporter
Copy link
Contributor

@jimporter jimporter commented Oct 22, 2025

This resolves #4465.

@jimporter jimporter force-pushed the commit-header-check branch from c5b85e2 to 2567ffc Compare October 22, 2025 03:06
@jimporter jimporter self-assigned this Oct 22, 2025
@jimporter jimporter marked this pull request as ready for review October 22, 2025 03:11
@jimporter jimporter requested review from ricab and xmkg October 22, 2025 03:11
@jimporter jimporter force-pushed the commit-header-check branch 2 times, most recently from 02df723 to d6ec246 Compare October 22, 2025 03:16
@jimporter jimporter force-pushed the commit-header-check branch from d6ec246 to c8b235e Compare October 22, 2025 03:17
Copy link
Collaborator

@ricab ricab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say the case is for us to define, no?

To me, upper case looks better to start a sentence/paragraph. That's the case with the rest of the text and what I am most used to seeing on Git/GH.

I am not opposed to case insensitive, but I would like to understand the motivation. If we allow that, we should update the corresponding contribution rules.

What was the sneaky error exactly?

@jimporter
Copy link
Contributor Author

jimporter commented Oct 22, 2025

I would say the case is for us to define, no?

To me, upper case looks better to start a sentence/paragraph. That's the case with the rest of the text and what I am most used to seeing on Git/GH.

That would be ok too, if that's what we decide. (Git describes these as being like RFC822 headers, so from Git's point of view, they should be case-insensitive.)

I am not opposed to case insensitive, but I would like to understand the motivation. If we allow that, we should update the corresponding contribution rules.

I noticed this when looking over the change again and saw that our code was checking for "Sentence-case", but the tests used "Title-Case", and so they should have been failing. I don't have an opinion about which style(s) we accept though. I just modified the code to match the now-fixed test.

What was the sneaky error exactly?

The test cases mixed string concatenation and commas incorrectly, so we weren't testing what we expected. For example:

            "[msg] Subject\n\n"
            "> This body line (verbatim text) is clearly over 72 characters long[...]",
            "",
            "> This body line (verbatim text) is clearly over 72 characters long[...]",
            "",
            "Regular text"

From reading the surrounding context, that should be a single commit message to test, but it's actually five:

  1. ""[msg] Subject\n\n> This body line (verbatim text) is clearly over 72 characters long[...]"
  2. ""
  3. "> This body line (verbatim text) is clearly over 72 characters long[...]"
  4. ""
  5. "Regular text"

@ricab
Copy link
Collaborator

ricab commented Oct 23, 2025

Got it, thank for clarifying @jimporter! I have a slight preference for Sentence case, but I don't mind changing it if you like, provided it's all in sync with CONTRIBUTING.md.

@jimporter jimporter requested a review from ricab October 23, 2025 18:07
@jimporter
Copy link
Contributor Author

Got it, thank for clarifying @jimporter! I have a slight preference for Sentence case, but I don't mind changing it if you like, provided it's all in sync with CONTRIBUTING.md.

We could also require Sentence case, but I think if that's our decision, we should make a separate rule for it so that we can report a more-specific error message. (Currently, we'd only report an error if the commit message contained a header like this that broke some other rule, like our line-length rule.)

@ricab
Copy link
Collaborator

ricab commented Oct 23, 2025

You're right, for some reason I was under the impression that the rules implied case today.

Copy link
Collaborator

@ricab ricab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, looking good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ci] Match commit headers (like Signed-off-by:) case-insensitively

2 participants